AlertDismissable
The AlertDismissable
component is a simple React component that displays a dismissable alert message. It is built using Bootstrap CSS classes for styling.
Usage
import AlertDismissable from '@site/src/components/AlertDismissable';
<AlertDismissable
show={true}
title="Alert Title"
>
This is an alert message.
</AlertDismissable>
Props
Prop | Type | Description |
---|---|---|
show | boolean | Controls the visibility of the alert. |
title | string | The title of the alert message. |
children | React.ReactNode | The content to be displayed within the alert. |
Example
This is how the AlertDismissable
component would be used in a React application.
import React, { useState } from 'react';
import AlertDismissable from '@site/src/components/AlertDismissable';
function Example() {
const [showAlert, setShowAlert] = useState(false);
return (
<div>
<button onClick={() => setShowAlert(true)}>Show Alert</button>
<AlertDismissable
show={showAlert}
title="Important Alert"
>
This is an important message that the user should see.
</AlertDismissable>
</div>
);
}